﻿package Space.SpaceObjects 
{
	import Space.SpaceObjects.Planet;
	import Space.SpaceObjects.SO;
	
	public class Star extends Space.SpaceObjects.SO
	{
		private var _planets:Array = new Array();
		
		public function Star(starX:Number, starY:Number, starZ:Number):void
		{
			this.x = starX;
			this.y = starY;
			this.z = starZ;
		}
		
		public function get Planets():Array
		{
			return _planets;
		}
		
		public function AddPlanet(planet:Planet):void
		{
			_planets[_planets.length] = planet;
		}
		
		public function NumberOfPlanets():Number
		{
			return _planets.length;
		}
		
		public function AddPlanet(newPlanet:Space.SpaceObjects.Planet)
		{
			_planets[_planets.length] = newPlanet;
		}
		
		public function NumberOfPlanets():Number
		{
			return _planets.length;
		}
		
		public function GetPlanet(index:int):Space.SpaceObjects.Planet
		{
			return _planets[index];
		}
	}
	
}